//------------------------------------------------------------------------
// Abstract: Define of class DBAdministrator and class DB
//
// Authoring: XiaoHanxiong
//
// Time: 2014.03.14
//
// Static test:
//
// Version history:
//		Ver_1.0	: 2014.03.14	XiaoHanxiong
//------------------------------------------------------------------------
#ifndef __Database_DBAdministrator_h_
#define __Database_DBAdministrator_h_

#include "Stdafx.h"

namespace Database
{
	enum _DATABASE DatabaseType
	{
		SQLite = 0,
		MySQL = 1
	};


	class _DATABASE IDatabase
	{
	protected:
		// Constructor
		IDatabase(DatabaseType type) :m_type(type){};
		// Destructor
		virtual ~IDatabase(){};
		// Administrate the create of DataBase object
		friend class DBAdministrator;

	protected:
		// The Database type
		DatabaseType m_type;
	};


	class _DATABASE IDatabaseHelper
	{
	public:
		// Constructor
		IDatabaseHelper(DatabaseType type) :m_type(type){};
		// Destructor
		virtual ~IDatabaseHelper(){};

	protected:
		// The Database type
		DatabaseType m_type;
	};



	class _DATABASE DBAdministrator
	{
	private:
		// Constructor
		DBAdministrator();
		// Destructor
		~DBAdministrator();

	public:
		// Create a DataBase object
		static IDatabase* Create(DatabaseType type);
		// Destory a DataBase object
		static void Destory(IDatabase* database);
		// Get the Database type
		static DatabaseType GetDatabaseType(IDatabase* database);
	};
}

#endif